owning-ref-rs
A library for creating references that carry their owner with them.
This can sometimes be useful because Rust borrowing rules normally prevent moving a type that has been moved from. For example, this kind of code gets rejected:
This library enables this safe usage by keeping the owner and the reference bundled together in a wrapper type that ensure that lifetime constraint:
Getting Started
owning-ref-rs is available on crates.io. It is recommended to look there for the newest released version, as well as links to the newest builds of the docs.
At the point of the last update of this README, the latest published version could be used like this:
Add the following dependency to your Cargo manifest...
[]
= "0.3"
...and see the docs for how to use it.
Example
extern crate owning_ref;
use BoxRef;